package missingNumber;

public class Solution {
    public int missingNumber(int[] nums) {
        int rightSum,sum=0;
        rightSum=((0+nums.length)*(nums.length+1))/2;
        for (int i=0;i<nums.length;i++)
        	sum=sum+nums[i];
        return rightSum-sum;
    }
}

/* MADEZHIZHANG*/